import { get, post, deleted } from '@/api/axios'
// 获取权限列表
export const getRightList = params => get(`rights/${params.type}`)


//获取角色列表
export const getRoleList = params => get(`roles`, params = {})


// 角色授权
// post    rids 需要是一个对象
export const grantRoleRight = (roleId, rids) => post(`roles/${roleId}/rights`, rids)




// 删除角色指定权限
export const deleteRoleRight = params => deleted(`roles/${params.roleId}/rights/${params.rightId}`)